package com.example.myapplication.part13;

import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.example.myapplication.R;

import java.util.ArrayList;
import java.util.List;

public class Part13Activity extends AppCompatActivity {

    private RecyclerView recyclerView;
    private CardAdapter cardAdapter;
    private List<CardItem> cardList;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_part13);

        recyclerView = findViewById(R.id.recycler_view);
        recyclerView.setLayoutManager(new LinearLayoutManager(this));

        cardList = new ArrayList<>();
        cardList.add(new CardItem("Card 1", "Description for card 1"));
        cardList.add(new CardItem("Card 2", "Description for card 2"));
        cardList.add(new CardItem("Card 3", "Description for card 3"));

        cardAdapter = new CardAdapter(cardList);
        recyclerView.setAdapter(cardAdapter);
    }
}
